package com.zscat.mallplus.center.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zscat.mallplus.center.entity.CenterJifenItem;
import com.zscat.mallplus.center.mapper.CenterJifenItemMapper;
import com.zscat.mallplus.center.service.ICenterJifenItemService;

/**
 * 积分余额明细Service业务层处理
 * 
 * @author Wsen
 * @date 2020-09-24
 */
@Service
public class CenterJifenItemServiceImpl implements ICenterJifenItemService 
{
    @Autowired
    private CenterJifenItemMapper centerJifenItemMapper;

    /**
     * 查询积分余额明细
     * 
     * @param id 积分余额明细ID
     * @return 积分余额明细
     */
    @Override
    public CenterJifenItem selectCenterJifenItemById(Long id)
    {
        return centerJifenItemMapper.selectCenterJifenItemById(id);
    }

    /**
     * 查询积分余额明细列表
     * 
     * @param centerJifenItem 积分余额明细
     * @return 积分余额明细
     */
    @Override
    public List<CenterJifenItem> selectCenterJifenItemList(CenterJifenItem centerJifenItem)
    {
        return centerJifenItemMapper.selectCenterJifenItemList(centerJifenItem);
    }

    /**
     * 新增积分余额明细
     * 
     * @param centerJifenItem 积分余额明细
     * @return 结果
     */
    @Override
    public int insertCenterJifenItem(CenterJifenItem centerJifenItem)
    {
        centerJifenItem.setCreateTime(new Date());
        return centerJifenItemMapper.insertCenterJifenItem(centerJifenItem);
    }

    /**
     * 修改积分余额明细
     * 
     * @param centerJifenItem 积分余额明细
     * @return 结果
     */
    @Override
    public int updateCenterJifenItem(CenterJifenItem centerJifenItem)
    {
        return centerJifenItemMapper.updateCenterJifenItem(centerJifenItem);
    }

    /**
     * 批量删除积分余额明细
     * 
     * @param ids 需要删除的积分余额明细ID
     * @return 结果
     */
    @Override
    public int deleteCenterJifenItemByIds(Long[] ids)
    {
        return centerJifenItemMapper.deleteCenterJifenItemByIds(ids);
    }

    /**
     * 删除积分余额明细信息
     * 
     * @param id 积分余额明细ID
     * @return 结果
     */
    @Override
    public int deleteCenterJifenItemById(Long id)
    {
        return centerJifenItemMapper.deleteCenterJifenItemById(id);
    }
}
